package top.waikin.aspect.annonation;

import top.waikin.aspect.aspect.CacheAspect;

import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
 * 开启缓存注解
 *
 * @author WaiKin
 * @date 2022/11/26
 * @see CacheAspect
 */
@Target(TYPE)
@Retention(RUNTIME)
public @interface EnableCache {
  /**
   * key前缀 e.g.: demo:user
   *
   * @return {@code String}
   */
  String keyPrefix();

  /**
   * 生存时间 默认十分钟
   *
   * @return long
   */
  long ttl() default 600L;
}
